import Vue from 'vue'
import VueRouter, {RouteConfig} from 'vue-router'

import Home from '../views/Home.vue'
import StudentEdit from '../views/student/EditStudent.vue';
import ListStudent from '../views/student/StudentList.vue';

Vue.use(VueRouter)

const routes: Array<RouteConfig> =
    [
      {
        path : '/',
        component : Home,
        name: "home",
        redirect: "/students/list",
        children : [
          {path : "/students/edit/:stuId", component : StudentEdit, props : true},
          {path : "/students/create", component : StudentEdit},
          {path : "/students/list", component : ListStudent},
        ]
      },
    ]

    const router = new VueRouter({routes})

export default router
